#ifndef UTIL_H
#define UTIL_H
#include<unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <errno.h>
#include <signal.h>

int getaddrlist(char* host,char* serve,struct addrinfo** res);
size_t tread(int fd,void* buf,size_t bufsize,int timeout);
size_t treadn(int fd,void* buf,size_t readsize,int timeout);
ssize_t readn(int fd, void *ptr,size_t n);
ssize_t writen(int fd,const void *ptr,size_t n);
#endif

